﻿using Microsoft.EntityFrameworkCore;
using Protocal.App.Common;
using Protocal.App.Entity;

namespace Protocal.App.DAL
{
    public class SqlServerDbContext : DbContext
    {
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
                string? sqliteDbConn = AppSetting.Get<string>("SqlServer");
                optionsBuilder.UseSqlServer(sqliteDbConn);
                optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
            }
        }

        public virtual DbSet<Data_User> DataUsers { get; set; }
    }
}
